//
//  NSNull+CLSafety.h
//
//  Created by Charlie Liao on 16/4/23.
//  Copyright © 2016年 . All rights reserved.
//

#import <Foundation/Foundation.h>

/// 判断是否为空
extern BOOL objIsNotNull(NSObject* _Nullable obj);

/// 安全取值，把NSNull类型转换掉
extern id _Nullable toSafeObject(NSObject* _Nullable unSafeObj);

@interface NSNull (CLSafety)

- (NSInteger)integerValue;

- (NSUInteger)unsignedIntegerValue;

- (int)intValue;

- (long long)longLongValue;

- (float)floatValue;

- (double)doubleValue;

- (BOOL)boolValue;

- (NSInteger)length;

- (nullable id)objectAtIndex:(NSUInteger)index;

- (nullable id)objectForKey:(nonnull NSString *)key;

- (BOOL)isEqualToString:(nullable NSString *)aString;

- (BOOL)isEqualToValue:(nullable NSValue *)value;

- (BOOL)isEqualToNumber:(nullable NSNumber *)number;

@end
